﻿$(function () {
    getMenu();
});
function getCarData(obj, type) {
    if ($(obj).val().length == 0)
        return;
    ZWEB.AJAX.Call("getCarData", load_callback, { parent_id: $(obj).val() });
    function load_callback(r_code, r_msg, r_obj) {
        if (type == 1) {
            $("#st_car_type").html("<option value=\"-1\">车型</option>" + r_obj);
        } else if (type == 2) {
            $("#st_displacement").html("<option value=\"-1\">排量</option>" + r_obj);
        }
    }
}
function disChange(obj) {
    if ($(obj).val().length > 0 && $(obj).val() != "-1") {
        $("#car_type").val($("#st_displacement").val());
        $("#sub_btn").removeAttr("disabled").removeClass("disabled");
    } else
        $("#sub_btn").attr("disabled", "disabled").addClass("disabled");
}

function subForm(code) {
    if (code.length > 0 && code != "-1") {
        $("#car_type").val(code);
        $("#fm").submit();
    } else
        alert("请选择车型！");
}

function showCarSt()
{
    $("#car_list").hide();
    $("#new_car").show();
}